-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Correct implementation of gcc specific internal functions #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
These implementations look good to me. Unlike the previous stubs, they actually work and, like kibergus says, if you don't want the extra overhead (which only occurs when declaring static variables with non-constant initializers) you can compile with @kibergus, could you confirm that you actually wrote this code and add a copyright header and license to this file? |
Yes, I've written them on my own and you can use this code as you want. Anyway, this is a sort of trivial code: you can't rewrite it in different stile if you want the same behaviour. Using -fno-threadsafe-statics by default may be a good choice for arduino IDE. If you do so, you can even drop definition of __cxa_guard_acquire, __cxa_guard_release and __cxa_guard_abort. |
The following empty stubs has been replaced by the gcc flag -fno-threadsafe-static: int __cxa_guard_acquire(__guard *); void __cxa_guard_release (__guard *); void __cxa_guard_abort (__guard *); The following empty stubs has been moved into their specific module abi.cpp: void __cxa_pure_virtual(void) __attribute ((noreturn)); void __cxa_deleted_virtual(void) __attribute ((noreturn)); Fix arduino#107
Solved with #2284. Thank you. |
added dualoptiboot to mysensors hardware profile
The following empty stubs has been replaced by the gcc flag -fno-threadsafe-static: int __cxa_guard_acquire(__guard *); void __cxa_guard_release (__guard *); void __cxa_guard_abort (__guard *); The following empty stubs has been moved into their specific module abi.cpp: void __cxa_pure_virtual(void) __attribute ((noreturn)); void __cxa_deleted_virtual(void) __attribute ((noreturn)); Fix arduino#107
This patch add correct implementation for:
Current implementations in arduino are just stubs that can lead to undefined behavior if one of that functions is used. __cxa_guard_acquire, __cxa_guard_release and __cxa_guard_abort are needed for thread safe initialization of static variables (in case if they can't be initialized at compile time). If you don't need thread safety just turn it of with -fno-threadsafe-statics. Buf if you provide it, provide correct implementation, not a stub.
__cxa_pure_virtual and __cxa_deleted_virtual are called if thing went really wrong and they must not return. They must terminate the program because it is already broken.